package com.learn.base;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * service聚合响应
 * 适用于复杂的service接口的返回对象
 *
 * @author yaoqihui
 * @version 2022/3/29 0029
 * @see [相关类/方法]
 */
@Data
@Accessors (chain = true)
public class R<T extends Serializable> implements Serializable
{
	private static final long serialVersionUID = - 2524219767849240472L;

	/**
	 * 响应数据
	 */
	private T data;

	/**
	 * 返回错误码
	 */
	private String resultCode;

	/**
	 * 返回描述
	 */
	private String resultMsg;

	public R (T data, String resultCode, String resultMsg)
	{
		this.data = data;
		this.resultCode = resultCode;
		this.resultMsg = resultMsg;
	}
}
